package com.tjoris.midigateway;

import java.util.concurrent.LinkedBlockingQueue;

class MidiWorkerThread extends Thread {
	private final LinkedBlockingQueue<IMidiAction> fActions;
	
	
	public MidiWorkerThread(final LinkedBlockingQueue<IMidiAction> actions) {
		super("MidiWorkerThread");
		fActions = actions;
	}
	
	public void run() {
		try {
			for (;;) {
				fActions.take().run();
			}
		}
		catch (final InterruptedException e) {
			// stop
		}
	}
}
